const { listArticleByCategory, getArticleDetail } = require("../service/blog");

module.exports = {
  async listArticleByCategory(ctx) {
    const result = await listArticleByCategory(ctx, ctx.query);

    ctx.body = {
      code: 0,
      message: "success",
      data: result,
    };
  },

  async getArticleDetail(ctx) {
    const result = await getArticleDetail(ctx, ctx.params.id);

    ctx.body = {
      code: 0,
      message: "success",
      data: result,
    };
  },
};
